package com.example.yjhadmin.controller;

import com.example.common.vo.Result;
import com.example.yjhadmin.service.StatisticFeign;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yc.yjh.entity.Statistics;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("yjh/admin")
public class StatisticController {
    @Resource
    StatisticFeign statisticFeign;

    @RequestMapping("selectAllStatistics")
    public PageInfo<Statistics> selectAllStatistics(@RequestParam int current){
        return statisticFeign.selectAllStatistics(current);
    }
    @RequestMapping("selectTotal")
    public Long selectTotal(){
        return statisticFeign.selectTotal();
    }
    @RequestMapping("addStatistic")
    public Result addStatistic(@RequestBody Statistics statistics){
        return statisticFeign.addStatistic(statistics);
    }

}
